using System;

namespace TTEngine.TTMath
{
    public struct Color
    {
        public float r;
        public float g;
        public float b;
        public float a;

        public Color(float _r, float _g, float _b, float _a)
        {
            r = Math.Clamp(_r, 0f, 1f);
            g = Math.Clamp(_g, 0f, 1f);
            b = Math.Clamp(_b, 0f, 1f);
            a = Math.Clamp(_a, 0f, 1f);
        }

        public static Color White
        {
            get
            {
                return new Color(1, 1, 1, 1);
            }
        }
        public static Color Black
        {
            get
            {
                return new Color(0, 0, 0, 1);
            }
        }
        public static Color Mul(Color a, Color b)
        {
            return new Color(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a);
        }
    }
}